#!/usr/bin/env python
# -*- coding:utf-8 -*-
import socket
import subprocess


def connect():
    while True:
        tcp_client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        tcp_client.connect(("172.31.100.250", 8090))
        print('sending..........')
        send_str = input()
        tcp_client.send(str.encode(send_str))

        print('reading...........')
        data = tcp_client.recv(1024)
        print(data)
        print("------------", data.decode().strip())
        cmd_call = subprocess.Popen("sh ./test.sh", shell=True, stdout=subprocess.PIPE)
        print(cmd_call)


if __name__ == '__main__':
    connect()
